package com.excel.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ExcelLogStatus {
    PENDING(0),    // 待开始
    PROCESSING(1), // 进行中
    SUCCESS(2),  // 成功
    TIMEOUT(3),    // 超时
    CANCELED(4),   // 取消
    FAIL(5);   // 失败

    private int value;


    public static ExcelLogStatus fromValue(int value) {
        for (ExcelLogStatus excelLogStatus : ExcelLogStatus.values()) {
            if (excelLogStatus.getValue() == value) {
                return excelLogStatus;
            }
        }
        throw new IllegalArgumentException("Invalid status value: " + value);
    }
}